package com.myFwk.config.redis.redisson;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;

/**
 * @Title: 使用redisson分布式锁
 * @Description:
 * @Author: guowl
 * @version： 1.0
 * @Date:2021/10/18
 * @Copyright: Copyright(c)2021 RedaFlight.com All Rights Reserved
 */
@Configuration
public class RedissonConfig {


    @Bean
    public RedissonClient getRedissonClinet() {

        Config config = new Config();
        //单节点
        config.useSingleServer().setAddress("redis://192.168.6.109:6379");
        config.useSingleServer().setPassword("admin");
        return Redisson.create(config);
    }


}
